<?php
class TextAreaWidget extends Widget{

	public function render($data){
		$api=new TS_API();
		$opt=$api->option_get('thinksns');
		$data['bq_emotion'] = D('Smile')->getSmile($opt['ico_type']);
		$data['site_opts']=$opt;
		
		//some default values
		
		if (!isset($data['id']))
			$data['id']='SuperTextArea';
		if (!isset($data['id_prefix']))
			$data['id_prefix']='';
		//if (!isset($data['onfocus']))
		//	$data['onfocus']='showToolbar()';
			
		if (!isset($data['onfocus']))
			$data['onfocus']='showToolbar("'.$data["id_prefix"].'","'.$data["id"].'");';
		
		if (!isset($data['max_chars']))
			$data['max_chars']=140;
		
		if (!isset($data['cols']))
			$data['cols']="''";
			
		/*if (!isset($data['onblur']))
			$data['onblur']='hideAll("'.$data["id_prefix"].'","'.$data["id"].'");';*/
							//"''";
		if (!isset($data['onclick']))
			$data['onclick']="''";
			
		if (!isset($data['name']))
			$data['name']="''";
			
		
		
		//thinkphp doesn't support operations on html template 
		//So we have id prefix can concatenate it with the id
		
		/*$data['id']=$data['id_prefix'].$data['id'];
		if (!isset($data['id_prefix']))
			$data['id_prefix']="";*/
		
        $content = $this->renderFile("TextArea",$data);

		
			
        return $content;

    }

}
?>